<?php /* Smarty version 2.6.16, created on 2012-10-31 00:55:40
         compiled from footer.tpl */ ?>
<div class="clear"></div>
</div>
<div class="push"></div>
</div>	
<div class="footer" <?php if ($_SESSION['user_id'] != ''): ?> style="padding-bottom: 35px" <?php endif; ?>>
   <div class="footer-inner">
		<div class="footer-right">
			<ul>
				<li><span>&copy; 2012 ChrionGaming. All rights reserved.</span></li>
				<li>|</li>
				<li><a href="termsconditions.php">Terms & Conditions</a></li>
				<li>|</li>
				<li><a href="privacypolicy.php">Privacy Policy</a></li>
				
			</ul>
		</div>
      <div class="footer-left">
         <ul style="float: left;">
            <li><a href="contactus.php">Contact Us</a></li>
            <li>|</li>
            <!--li><a href="#">Forum</a></li>
            <li>|</li-->
            
            <li><a href="replays.php">Replays</a></li>
            <li>|</li>
			<li><a href="find_training_partner.php">Find Training Partner</a></li>
            <li>|</li>
            <li><a href="findcoach.php">Find Coach</a></li>
            <li>|</li>
            <li><a href="howitworks.php">How It Works</a></li>
            <li>|</li>
            <li><a href="index.php">Home</a></li>
         </ul>
      </div>
   </div>
</div>	
<?php if ($_SESSION['user_id'] != ''): ?>
	<div class="phonoHldr" style="display:block;">
   		<div id="MyChatSession" class="phono">
   		 	<!--<div class="phonoHeader" style="display:none;">
   		 		<a href="#" title="Remove" class="closePhono"></a>
   		 		<span class="phonoIDLabel phonoID"></span><span class="audioType"></span><span class="phonoIDLabel">Session Id:</span> <span class="sessionId"><img style="margin-left:10px;" align="absmiddle" src="images/spinner.gif"/></span>
   		 	</div>
   		 	<div class="phoneControl"> 
   		 	    <div class="inputs" style="display:none;">
   		 	    	<input type="text" class="chatTo pretty" value=""/>
   		 			<input type="button" class="chat" value="Chat"/>
   		 		</div>
   		 	</div>-->
   		 	<div class="chats">
				<ul />
   		 		<!--<div class="chatHldr" style="display:none;">
   		 			<div class="chatHeader">
   		 				<a href="#" title="Remove" class="closeChat"></a>
   		 				<span class="chatID"></span>
   		 			</div>
   		 			<div class="chatBox"></div>
   		 			<div class="chatInputHldr">
   		 				<input type="text" class="chatTxtInput"/> 
   		 				<input type="button" class="sendMsg" value="send"/>
   		 			</div>
   		 		</div>-->
   		 	</div>
   		 </div>
	</div>
	<?php echo '
	<script>
		function changeStatus(event,status){
			event.stopPropagation();
			jQuery.post("actionService.php",{"method": "changeOnlineStatus", "status": status}, function(data){
					//alert(data.Msg);
					var newStatus = "online";
					if(status == 0)
						newStatus = "offline";
					else if(status == 2)
						newStatus = "away";
					else if(status == 3)
						newStatus = "busy";
						
					jQuery(\'#online_status_button\').removeClass(\'offline online busy away\').addClass(newStatus);
				},\'json\'
			);
		}
	</script>
	'; ?>

	<div id="bottombar" style=""> 
		<ul>
			<li id="freicontain_wrap3" class="freicontain_wrap">
				<a href="javascript:;" class="chat_button" id="chat_button3" style="display: none;"> 
				</a>
				<div class='freicontain freicontain3' id='freicontain3'></div>
			</li>
			<li id="freicontain_wrap2" class="freicontain_wrap">
				<a href="javascript:;" class="chat_button" id="chat_button2" style="display: none;"> 
				</a>
				<div class='freicontain freicontain2' id='freicontain2'></div>
			</li>
			<li id="freicontain_wrap1" class="freicontain_wrap">
				<a href="javascript:;" class="chat_button" id="chat_button1" style="display: none;"> 
				</a>
				<div class='freicontain freicontain1' id='freicontain1'></div>
			</li>
			<li id="freicontain_wrap0" class="freicontain_wrap">
				<a href="javascript:;" class="chat_button" id="chat_button0" style="display: none;"> 
				</a>
				<div class='freicontain freicontain0' id='freicontain0'></div>
			</li>
			
			<li><a href="javascript:;" onclick="notifications.showNotifications(event)" class="notifications_button"> Notifications <div class="notifications_quantity"></div> </a></li>
				
			<li class="players_li" id="players_li">
				<a href="javascript:;" class="players_button">Players 
					<div class="new_messages"></div>
				</a>
				<div class="players_list" id="players_list" style="">
					<div class="status_changer_title" >Players</div> 
					<div style="" class="players_list_wrapper">
					<?php unset($this->_sections['friendIndex']);
$this->_sections['friendIndex']['name'] = 'friendIndex';
$this->_sections['friendIndex']['loop'] = is_array($_loop=$this->_tpl_vars['friends']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['friendIndex']['show'] = true;
$this->_sections['friendIndex']['max'] = $this->_sections['friendIndex']['loop'];
$this->_sections['friendIndex']['step'] = 1;
$this->_sections['friendIndex']['start'] = $this->_sections['friendIndex']['step'] > 0 ? 0 : $this->_sections['friendIndex']['loop']-1;
if ($this->_sections['friendIndex']['show']) {
    $this->_sections['friendIndex']['total'] = $this->_sections['friendIndex']['loop'];
    if ($this->_sections['friendIndex']['total'] == 0)
        $this->_sections['friendIndex']['show'] = false;
} else
    $this->_sections['friendIndex']['total'] = 0;
if ($this->_sections['friendIndex']['show']):

            for ($this->_sections['friendIndex']['index'] = $this->_sections['friendIndex']['start'], $this->_sections['friendIndex']['iteration'] = 1;
                 $this->_sections['friendIndex']['iteration'] <= $this->_sections['friendIndex']['total'];
                 $this->_sections['friendIndex']['index'] += $this->_sections['friendIndex']['step'], $this->_sections['friendIndex']['iteration']++):
$this->_sections['friendIndex']['rownum'] = $this->_sections['friendIndex']['iteration'];
$this->_sections['friendIndex']['index_prev'] = $this->_sections['friendIndex']['index'] - $this->_sections['friendIndex']['step'];
$this->_sections['friendIndex']['index_next'] = $this->_sections['friendIndex']['index'] + $this->_sections['friendIndex']['step'];
$this->_sections['friendIndex']['first']      = ($this->_sections['friendIndex']['iteration'] == 1);
$this->_sections['friendIndex']['last']       = ($this->_sections['friendIndex']['iteration'] == $this->_sections['friendIndex']['total']);
?>
						<?php if ($this->_tpl_vars['friends'][$this->_sections['friendIndex']['index']]['name'] != ''): ?>
						<div class="players_link_<?php echo $this->_tpl_vars['friends'][$this->_sections['friendIndex']['index']]['firstLetter']; ?>
" onclick="friendActionClick(event,<?php echo $this->_tpl_vars['friends'][$this->_sections['friendIndex']['index']]['user_id']; ?>
,'<?php echo $this->_tpl_vars['friends'][$this->_sections['friendIndex']['index']]['name']; ?>
')">
							<span class="<?php echo $this->_tpl_vars['friends'][$this->_sections['friendIndex']['index']]['status']; ?>
" title="<?php echo $this->_tpl_vars['friends'][$this->_sections['friendIndex']['index']]['status']; ?>
"></span>
							<span style="color: white;" class=""><?php echo $this->_tpl_vars['friends'][$this->_sections['friendIndex']['index']]['name']; ?>
</span>
						</div>
						<?php endif; ?>
					<?php endfor; endif; ?>
					</div>
					<div class="letter_list">
					<?php unset($this->_sections['letterIndex']);
$this->_sections['letterIndex']['name'] = 'letterIndex';
$this->_sections['letterIndex']['loop'] = is_array($_loop=$this->_tpl_vars['letters']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['letterIndex']['show'] = true;
$this->_sections['letterIndex']['max'] = $this->_sections['letterIndex']['loop'];
$this->_sections['letterIndex']['step'] = 1;
$this->_sections['letterIndex']['start'] = $this->_sections['letterIndex']['step'] > 0 ? 0 : $this->_sections['letterIndex']['loop']-1;
if ($this->_sections['letterIndex']['show']) {
    $this->_sections['letterIndex']['total'] = $this->_sections['letterIndex']['loop'];
    if ($this->_sections['letterIndex']['total'] == 0)
        $this->_sections['letterIndex']['show'] = false;
} else
    $this->_sections['letterIndex']['total'] = 0;
if ($this->_sections['letterIndex']['show']):

            for ($this->_sections['letterIndex']['index'] = $this->_sections['letterIndex']['start'], $this->_sections['letterIndex']['iteration'] = 1;
                 $this->_sections['letterIndex']['iteration'] <= $this->_sections['letterIndex']['total'];
                 $this->_sections['letterIndex']['index'] += $this->_sections['letterIndex']['step'], $this->_sections['letterIndex']['iteration']++):
$this->_sections['letterIndex']['rownum'] = $this->_sections['letterIndex']['iteration'];
$this->_sections['letterIndex']['index_prev'] = $this->_sections['letterIndex']['index'] - $this->_sections['letterIndex']['step'];
$this->_sections['letterIndex']['index_next'] = $this->_sections['letterIndex']['index'] + $this->_sections['letterIndex']['step'];
$this->_sections['letterIndex']['first']      = ($this->_sections['letterIndex']['iteration'] == 1);
$this->_sections['letterIndex']['last']       = ($this->_sections['letterIndex']['iteration'] == $this->_sections['letterIndex']['total']);
?>
						<span class="letter letter_<?php echo $this->_tpl_vars['letters'][$this->_sections['letterIndex']['index']]; ?>
" onclick="filterFriend(event,'<?php echo $this->_tpl_vars['letters'][$this->_sections['letterIndex']['index']]; ?>
')">
							<?php echo $this->_tpl_vars['letters'][$this->_sections['letterIndex']['index']]; ?>

						</span><br/>
					<?php endfor; endif; ?>
					</div>
				</div>
			</li>
				
			<li class="online_status_li">
				<a id="online_status_button" href="javascript:;" class="online_status <?php echo $this->_tpl_vars['online_status']; ?>
"> 
					<div class="">
					</div>
				</a> 
				<div class="online_status_changer">
					<div class="status_changer_title" >Online Status</div>
					<div class="online status_changer" onclick="changeStatus(event,1);" >online</div>
					<div class="away status_changer" onclick="changeStatus(event,2);">away</div>
					<div class="busy status_changer" onclick="changeStatus(event,3);">busy</div>
					<div class="offline status_changer" onclick="changeStatus(event,0);">offline</div>
				</div>
				
			</li>
				<!--li><a href="#">Forum</a></li>
				<li>|</li-->
				
			<li><a href="#">All times are UTC</a></li>
		</ul>
	</div>	
<?php endif; ?>

</div>

<?php if ($_SESSION['user_id'] != ''): ?>
<script type="text/javascript" language="javascipt"src="http://chiron/freichat/client/main.php?id=<?php echo $this->_tpl_vars['user_id']; ?>
&xhash=<?php echo $this->_tpl_vars['xhash']; ?>
"></script>
<script src="http://s.phono.com/releases/0.5/jquery.phono.js"></script>
<?php echo '
<script type="text/javascript" language="javascipt">
	window.phono = $.phono({
		apiKey: "7dc3cacb3694d75bea38adbab0df388e",
	  	onReady: function() {
	    	//alert("My Address address is sip:" + this.sessionId);
	    	//TODO: Set Session ID, Show call button
	    	setPhonoSessionId(this.sessionId);
	    	FreiChat.enableCallButton();
	  	},
	  	audio: {
            type: "flash",
            direct: false,
            onPermissionBoxShow: function(event) {},
            onPermissionBoxHide: function(event) {}
    	},	  
		phone: {
			ringTone: "/audio/Diggztone_DigitalSanity.mp3",
			ringbackTone: "/audio/ringback-uk.mp3",
		    headset: true,
		    onIncomingCall: function(event) {
		    	window.phonoCall = event.call;
		    	incomingCall();
		    },
		    onError: function(event) {
		        console.log("Phone error: " + e.reason);
		        
		    }
		}
	});
	
	function makeCall(fromname,fromUserId,toUserId){
		jQuery.post("actionService.php",{"method": "getUser","userId":toUserId}, function(data){
			window.phonoCall = phono.phone.dial(data.phono_session, {

				gain: 25,
		        volume: 75,
		        mute: false,
		        pushToTalk: false,
				
		        // Events
		        onRing: function() {
		         	console.log("Ringing");
		         	FreiChat.changeToRingingButton(getHeader("x-fromuserid"));
		        },
		        onAnswer: function() {
		          	console.log("Answered");
		          	FreiChat.changeToHangUpCallButton(getHeader("x-fromuserid"));
		        },
		        onHangup: function() {
		        	console.log(\'------ hangedup ------\');
		      		FreiChat.changeToMakeCallCallButton(getHeader("x-fromuserid"));
		        },
		        onError: function() {
		          	console.log("Call Error");
		        },
		        headers: [{
                    name: "x-fromname",
                    value: fromname
		        },
		        {
                    name: "x-fromuserid",
                    value: fromUserId
                },
		        {
                    name: "x-touserid",
                    value: toUserId
                }]
		      });
		    
			
		},"json");
		
	}
	
	function incomingCall(){		
		var message = "Anonymous call";
		var fromname = getHeader(\'x-fromname\');
		if(fromname)
			message = "<b>"+fromname+"</b> is calling";
		id = getHeader("x-fromuserid");
		
		showYesNo(message, "", \'FreiChat.changeToHangUpCallButton(\'+id+\');answer();\', \'hangup()\',\'Answer\',\'Reject\');
	}
	
	function getHeader(name){
		var headerSize = window.phonoCall.headers.length;
// 		var i = 0;
		for(var i = 0; i < headerSize; i++){
			var header = window.phonoCall.headers[i];
			if(header.name == name){
				return header.value;
				break;
			}
		}
		return undefined;
	}
	function answer(){
		console.log(\'------ answer ------\');
		window.phonoCall.answer();;
	}
	function hangup(){
		console.log(\'------ hangingup ------\');
		window.phonoCall.hangup();
		window.phonoCall.stopAudio();
		FreiChat.changeToMakeCallCallButton(getHeader("x-fromuserid"));
	}
	function mute(mute){
		window.phonoCall.mute(mute);
	}
	function talking(talk){
		window.phonoCall.talking(talk);
	}
	
	
</script>
'; ?>

<?php endif; ?>
<?php echo '
<script type="text/javascript" src="jss/bottomJs.js"></script>
'; ?>

</body>
</html>